<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<!DOCTYPE html PUBLIC "-//W3C//Ddiv HTML 4.01 divansitional//EN" "http://www.w3.org/div/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-81">
  <%@ include file="/WEB-INF/include/meta.jsp"%>
  <%@ include file="/WEB-INF/include/css.jsp"%>
  <link href="${ctx.resource}/css/goals.css" rel="stylesheet">
  <title>人马君</title>
</head>
<body>
  <body>
    <div class="page-group">
      <div class="page page-current">
        <header class="bar bar-nav fs-header-small">
          <a href="${ctx.host}/course-schedules?day=${courseSchedule.occurDate}&hour=${courseSchedule.occurHour}" class="icon icon-left pull-left"></a>
          <h1 class="title">添加动作</h1>
        </header>
        
        <div class="bar bar-footer" style="padding: 0;display: none;">
          <button class="button button-fill add" style="top: 0;background: #fedc32; font-size: 1rem; font-weight: bold; color: #333; min-height: 2.2rem; width: 100%;">添加动作</button>
        </div>

        <div class="content">
          <div class="content-block no-margin">
            <div class="searchbar row courseware-searchbar">
              <div class="search-input col-80">
                <input type="search" id='search' name="movementName" value="${courseware.movement.name}" placeholder='输入关键字...'/>
              </div>
              <a class="button button-fill button-primary col-20 search-button">搜索</a>
            </div>
          </div>
          
          <div class="movement-box">
            <div class='list-block media-list'>
              <form name='add_form'>
                <ul>
                  <c:forEach var="movement" items="${movements}">
                    <li class="movement-radio">
                      <label class="label-checkbox item-content">
                        <input type="checkbox" name="movementId" value="${movement.id}">
                        <div class="item-media"><i class="icon icon-form-checkbox"></i></div>
                        <div class="item-inner">
                          <div class="item-title-row">
                            <div class="item-title">${movement.name}</div>
                          </div>
                          <div class="item-subtitle">${movement.summary}</div>
                        </div>
                      </label>
                    </li>
                  </c:forEach>
                </ul>
              </form>
            </div>
          </div>
          <p style="text-align: center;">搜不到动作？<span class="add-button" style="color: blue;text-decoration:underline">点此添加</span></p>
        </div>
      </div>
    </div>
    <%@ include file="/WEB-INF/include/script.jsp"%>
    <d:resource root="${ctx.resource}/build" type="script" src="js/page/courseware/course-courseware-modify.js" />
    <script type="text/javascript">
       require(['page/courseware/course-courseware-modify'], function(page) {
        page.init({
            'roundId': '${courseSchedule.courseRound.id}',
            'courseScheduleId': '${courseSchedule.id}',
            'day': '${courseSchedule.occurDate}',
            'hour': '${courseSchedule.occurHour}',
            'coursewareId': '${courseware.id}',
            'groupAmount': '${courseware.groupAmount}',
            'movementNumber': '${courseware.movementNumber}',
            'maxWeight': '${courseware.maxWeight}',
            'time': '${courseware.time}',
            'remark': '${courseware.remark}'
        });
      }) 
    </script>
  </body>
</html>
